﻿@using SimpleFramework.Web.Navigation
@using System.Text
@model NavigationViewModel
@if (Model.HasVisibleChildren(Model.StartingNode))
{
    <div class="navbar-default sidebar" role="navigation">
        <div class="sidebar-nav navbar-collapse">
            <ul class="nav" id="side-menu">
     @foreach (var node in Model.StartingNode.Children)
    {
        if (!Model.ShouldAllowView(node)) { continue; }
        if (!Model.HasVisibleChildren(node))
        {
            <li class='@Model.GetClass(node.Value)'><a href="@Url.Content(Model.AdjustUrl(node))">@Html.Raw(Model.GetIcon(node.Value))@Model.AdjustText(node)</a></li>
        }
        else
        {
            <li class='@Model.GetClass(node.Value)'>
                <a href="@Url.Content(Model.AdjustUrl(node))">@Html.Raw(Model.GetIcon(node.Value))@Model.AdjustText(node)</a>
                @Model.UpdateTempNode(node)@Html.Partial("NavigationNodeSideNavPartial", Model)
            </li>   
        }
    }
           </ul>
        </div>
    </div>
 }
